﻿#include "OperatorsColorMap.h"
#include "GUIFrame/MainWindow.h"
#include "PickDataProvider/PickedDataProvider.h"
#include "PickDataProvider/GUIPickInfo.h"
#include "OperatorsInterface/GraphEventOperator.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "GUIDialog/GUIToolDialog/GUIObjectColorMapDialog.h"
#include <QMessageBox>

namespace ModelOper
{
    bool OperatorsColorMap::execGUI()
    {
        GUI::MainWindow * mainWindow = dynamic_cast<GUI::MainWindow *>(FITKAPP->getGlobalData()->getMainWindow());
        if (!mainWindow)return false;

        GUI::GUIObjectColorMapDialog* dialog = new GUI::GUIObjectColorMapDialog(mainWindow);
        connect(dialog, &QDialog::accepted, this, &OperatorsColorMap::execProfession);
        dialog->show();
        return false;
    }
    bool OperatorsColorMap::execProfession()
    {
        //获取渲染数据
        EventOper::GraphEventOperator* graphOper = FITKOPERREPO->getOperatorT<EventOper::GraphEventOperator>("GraphPreprocess");
        if (graphOper == nullptr)return false;
        graphOper->updateAll(true);
        return true;
    }
}

